/**
 * 基础路由
 * @type { *[] }
 */

const constantRouterMap = [
  {
    path: '/',
    component: () => import('@/views/portal/Layout.vue'),
    meta: {
      requiresAuth: true  // 默认需要登录认证
    },
    children: [
      {
        path: '',
        redirect: 'home'
      },
      {
        path: 'home',
        name: 'Home',
        component: () => import('@/views/portal/Home.vue'),
        meta: {
          title: '首页',
          requiresAuth: true
        }
      },
      {
        path: 'profile',
        name: 'Profile',
        component: () => import('@/views/personal/Profile.vue'),
        meta: {
          title: '个人资料',
          requiresAuth: true
        }
      },
      {
        path: 'settings',
        name: 'Settings',
        component: () => import('@/views/personal/Settings.vue'),
        meta: {
          title: '设置',
          requiresAuth: true
        }
      },
      {
        path: 'ai-chat',
        name: 'AIChat',
        component: () => import('@/views/ai/ChatView.vue'),
        meta: {
          title: 'AI对话',
          requiresAuth: true
        }
      },
      {
        path: 'order-manage',
        name: 'OrderManage',
        component: () => import('@/views/order/OrderManage.vue'),
        meta: {
          title: '订单管理',
          requiresAuth: true
        }
      },
      {
        path: 'cart',
        name: 'Cart',
        component: () => import('@/views/shop/Cart.vue'),
        meta: {
          title: '购物车',
          requiresAuth: true
        }
      },
      {
        path: 'chess',
        name: 'ChessGame',
        component: () => import('@/views/games/ChessGame.vue'),
        meta: {
          title: '中国象棋',
          requiresAuth: true
        }
      },
      {
        path: 'sensitive-word',
        name: 'SensitiveWord',
        component: () => import('@/views/sensitive/SensitiveWordManager.vue'),
        meta: {
          title: '敏感词管理',
          requiresAuth: true,
          roles: ['admin', 'manager']
        }
      }
    ]
  }
]

export default constantRouterMap
